

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>CephFS Exports over NFS &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../../_static/favicon.ico"/>
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/underscore.js"></script>
        <script src="../../_static/doctools.js"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../genindex/" />
    <link rel="search" title="Search" href="../../search/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../" class="icon icon-home"></a> &raquo;</li>
        
      <li>CephFS Exports over NFS</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../../_sources/cephfs/fs-nfs-exports.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../">
          

          
            
            <img src="../../_static/logo.png" class="logo" alt="Logo"/>
          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul>
<li class="toctree-l1"><a class="reference internal" href="../../start/intro/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1"><a class="reference internal" href="../">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <div class="section" id="cephfs-exports-over-nfs">
<h1>CephFS Exports over NFS<a class="headerlink" href="#cephfs-exports-over-nfs" title="Permalink to this headline">¶</a></h1>
<p>CephFS namespaces can be exported over NFS protocol using the
<a class="reference external" href="https://github.com/nfs-ganesha/nfs-ganesha/wiki">NFS-Ganesha NFS server</a>.</p>
<div class="section" id="requirements">
<h2>Requirements<a class="headerlink" href="#requirements" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><p>Latest Ceph file system with mgr enabled</p></li>
<li><p>‘nfs-ganesha’, ‘nfs-ganesha-ceph’, ‘nfs-ganesha-rados-grace’ and
‘nfs-ganesha-rados-urls’ packages (version 3.3 and above)</p></li>
</ul>
</div>
<div class="section" id="create-nfs-ganesha-cluster">
<h2>Create NFS Ganesha Cluster<a class="headerlink" href="#create-nfs-ganesha-cluster" title="Permalink to this headline">¶</a></h2>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ceph nfs cluster create &lt;<span class="nv">type</span><span class="o">=</span>cephfs&gt; &lt;clusterid&gt; <span class="o">[</span>&lt;placement&gt;<span class="o">]</span>
</pre></div>
</div>
<p>This creates a common recovery pool for all Ganesha daemons, new user based on
cluster_id and common ganesha config rados object.</p>
<p>Here type is export type and placement specifies the size of cluster and hosts.
For more details on placement specification refer the <a class="reference external" href="https://docs.ceph.com/docs/master/mgr/orchestrator/#placement-specification">orchestrator doc</a>.
Currently only CephFS export type is supported.</p>
</div>
<div class="section" id="update-nfs-ganesha-cluster">
<h2>Update NFS Ganesha Cluster<a class="headerlink" href="#update-nfs-ganesha-cluster" title="Permalink to this headline">¶</a></h2>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ceph nfs cluster update &lt;clusterid&gt; &lt;placement&gt;
</pre></div>
</div>
<p>This updates the deployed cluster according to the placement value.</p>
</div>
<div class="section" id="delete-nfs-ganesha-cluster">
<h2>Delete NFS Ganesha Cluster<a class="headerlink" href="#delete-nfs-ganesha-cluster" title="Permalink to this headline">¶</a></h2>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ceph nfs cluster delete &lt;clusterid&gt;
</pre></div>
</div>
<p>This deletes the deployed cluster.</p>
</div>
<div class="section" id="list-nfs-ganesha-cluster">
<h2>List NFS Ganesha Cluster<a class="headerlink" href="#list-nfs-ganesha-cluster" title="Permalink to this headline">¶</a></h2>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ceph nfs cluster ls
</pre></div>
</div>
<p>This lists deployed clusters.</p>
</div>
<div class="section" id="show-nfs-ganesha-cluster-information">
<h2>Show NFS Ganesha Cluster Information<a class="headerlink" href="#show-nfs-ganesha-cluster-information" title="Permalink to this headline">¶</a></h2>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ceph nfs cluster info <span class="o">[</span>&lt;clusterid&gt;<span class="o">]</span>
</pre></div>
</div>
<p>This displays ip and port of deployed cluster.</p>
</div>
<div class="section" id="create-cephfs-export">
<h2>Create CephFS Export<a class="headerlink" href="#create-cephfs-export" title="Permalink to this headline">¶</a></h2>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ceph nfs <span class="nb">export</span> create cephfs &lt;fsname&gt; &lt;clusterid&gt; &lt;binding&gt; <span class="o">[</span>--readonly<span class="o">]</span> <span class="o">[</span>--path<span class="o">=</span>/path/in/cephfs<span class="o">]</span>
</pre></div>
</div>
<p>It creates export rados objects containing the export block. Here binding is
the pseudo root name and type is export type.</p>
</div>
<div class="section" id="delete-cephfs-export">
<h2>Delete CephFS Export<a class="headerlink" href="#delete-cephfs-export" title="Permalink to this headline">¶</a></h2>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ceph nfs <span class="nb">export</span> delete &lt;clusterid&gt; &lt;binding&gt;
</pre></div>
</div>
<p>It deletes an export in cluster based on pseudo root name (binding).</p>
</div>
<div class="section" id="list-cephfs-export">
<h2>List CephFS Export<a class="headerlink" href="#list-cephfs-export" title="Permalink to this headline">¶</a></h2>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ceph nfs <span class="nb">export</span> ls &lt;clusterid&gt; <span class="o">[</span>--detailed<span class="o">]</span>
</pre></div>
</div>
<p>It lists export for a cluster. With detailed option enabled it shows entire
export block.</p>
</div>
<div class="section" id="get-cephfs-export">
<h2>Get CephFS Export<a class="headerlink" href="#get-cephfs-export" title="Permalink to this headline">¶</a></h2>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ceph nfs <span class="nb">export</span> get &lt;clusterid&gt; &lt;binding&gt;
</pre></div>
</div>
<p>It displays export block for a cluster based on pseudo root name (binding).</p>
</div>
<div class="section" id="configuring-nfs-ganesha-to-export-cephfs-with-vstart">
<h2>Configuring NFS-Ganesha to export CephFS with vstart<a class="headerlink" href="#configuring-nfs-ganesha-to-export-cephfs-with-vstart" title="Permalink to this headline">¶</a></h2>
<ol class="arabic">
<li><p>Using cephadm</p>
<blockquote>
<div><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ <span class="nv">MDS</span><span class="o">=</span><span class="m">1</span> <span class="nv">MON</span><span class="o">=</span><span class="m">1</span> <span class="nv">OSD</span><span class="o">=</span><span class="m">3</span> <span class="nv">NFS</span><span class="o">=</span><span class="m">1</span> ../src/vstart.sh -n -d --cephadm
</pre></div>
</div>
<p>It can deploy only single ganesha daemon with vstart on default ganesha port.</p>
</div></blockquote>
</li>
<li><p>Using test orchestrator</p>
<blockquote>
<div><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ <span class="nv">MDS</span><span class="o">=</span><span class="m">1</span> <span class="nv">MON</span><span class="o">=</span><span class="m">1</span> <span class="nv">OSD</span><span class="o">=</span><span class="m">3</span> <span class="nv">NFS</span><span class="o">=</span><span class="m">1</span> ../src/vstart.sh -n -d
</pre></div>
</div>
<p>It can deploy multiple ganesha daemons on random port. But this requires
ganesha packages to be installed.</p>
</div></blockquote>
</li>
</ol>
<p>NFS: It is the number of NFS-Ganesha clusters to be created.</p>
</div>
<div class="section" id="mount">
<h2>Mount<a class="headerlink" href="#mount" title="Permalink to this headline">¶</a></h2>
<p>After the exports are successfully created and Ganesha daemons are no longer in
grace period. The exports can be mounted by</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ mount -t nfs -o <span class="nv">port</span><span class="o">=</span>&lt;ganesha-port&gt; &lt;ganesha-host-name&gt;:&lt;ganesha-pseudo-path&gt; &lt;mount-point&gt;
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Only NFS v4.0+ is supported.</p>
</div>
</div>
</div>



           </div>
           
          </div>
          <footer>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).

    </p>
  </div> 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>